﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using System.IO.IsolatedStorage;

namespace WindowsPhoneApplication1
{

    public partial class trackPage2 : PhoneApplicationPage
    {

        String my_name = "beeri";
        String my_loc = "northern negev";
        String my_diff = "easy";
        String my_acc = "yes";
        double longitude = 34.5543;
        double latitude = 31.5063;

        public trackPage2()
        {
            InitializeComponent();
        }

        private void toMap_Click(object sender, RoutedEventArgs e)
        {
            IsolatedStorageSettings settings = IsolatedStorageSettings.ApplicationSettings;
           // settings.Add("longitude", longitude);
            //settings.Add("latitude", latitude);
            if (!settings.Contains("longitude"))
                settings.Add("longitude", longitude);
            else
                settings["longitude"] = longitude;

            if (!settings.Contains("latitude"))
                settings.Add("latitude", latitude);
            else
                settings["latitude"] = latitude;

            if (!settings.Contains("name"))
                settings.Add("name", my_name);
            else
                settings["name"] = my_name;

            settings.Save();
            NavigationService.Navigate(new Uri("/mapPage.xaml", UriKind.RelativeOrAbsolute));

        }

        private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
        {
            name.Text = my_name;
            location.Text = my_loc;
            difficulty.Text = my_diff;
            accessibility.Text = my_acc;
        }

    }
}